﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="AddEmployee.aspx.cs" Inherits="Bitirme.Views.AddEmployee" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script language="javascript" type="text/javascript">
        $(document).ready(function () {
            var capabilityString = "";
            var skillString = "";
            $("#YetenekEkle").click(function () {
                var skill = 0;
                var color = "";

                if ($("#MainContent_Radio1").is(':checked') == true) {
                    color = 'style = "background-color:Red; cursor:pointer;"';
                    skill = 1;
                } else if ($("#MainContent_Radio2").is(':checked') == true) {
                    color = 'style = "background-color:#FF9933; cursor:pointer;"';
                    skill = 2;
                } else if ($("#MainContent_Radio3").is(':checked') == true) {
                    color = 'style = "background-color:Lime; cursor:pointer;"';
                    skill = 3;
                }
                $("#YeteneklerList").append("<p><span id='tag'" + color + ">" + $("#MainContent_CapabilityTextBox").val() + "</span></p>");
                capabilityString = capabilityString + $("#MainContent_CapabilityTextBox").val() + ",";
                skillString = skillString + skill + ",";
            });
            $("#MainContent_Button1").submit(function () {
                $("#MainContent_CapabilityString").val(capabilityString);
                $("#MainContent_SkillString").val(skillString);
            });
            $(".removeTag").click(function (e) {
                alert("heyy");
            });
            $("#tag").live('click', function () {
                //$(this).slideUp();
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <br />

<fieldset class="login">
    <legend>Çalışan Ekle</legend>
    <span class="failureNotification">
        <asp:Literal ID="FailureText" runat="server"></asp:Literal>
    </span>
    <asp:ValidationSummary ID="AddEmployeeValidationSummary" runat="server" CssClass="failureNotification" ValidationGroup="AddEmployeeValidationGroup" />
    <p>
        <asp:Label ID="NameLabel" runat="server" AssociatedControlID="NameTextBox">Adı:</asp:Label>
        <asp:TextBox ID="NameTextBox" runat="server" CssClass="textEntry"></asp:TextBox>
        <asp:RequiredFieldValidator ID="NameRequired" runat="server" ControlToValidate="NameTextBox" 
                             CssClass="failureNotification" ErrorMessage="Çalışanın İsmi Boş Bırakılamaz." ToolTip="Çalışanın Adını Giriniz." 
                             ValidationGroup="AddEmployeeValidationGroup">*</asp:RequiredFieldValidator>
    </p>
    <p>
        <asp:Label ID="SurNameLabel" runat="server" AssociatedControlID="SurnameTextBox">Soyadı:</asp:Label>
        <asp:TextBox ID="SurnameTextBox" runat="server" CssClass="textEntry"></asp:TextBox>
        <asp:RequiredFieldValidator ID="SurNameRequired" runat="server" ControlToValidate="SurnameTextBox" 
                             CssClass="failureNotification" ErrorMessage="Çalışanın Soyadı Boş Bırakılamaz." ToolTip="Çalışanın Soyadını Giriniz." 
                             ValidationGroup="AddEmployeeValidationGroup">*</asp:RequiredFieldValidator>
    </p>
    <p>
        <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="EmailTextBox">E-mail Adresi:</asp:Label>
        <asp:TextBox ID="EmailTextBox" runat="server" CssClass="textEntry"></asp:TextBox>
        <asp:RequiredFieldValidator ID="EMailRequired" runat="server" ControlToValidate="EmailTextBox" 
                             CssClass="failureNotification" ErrorMessage="Çalışanın E-mail Adresi Boş Bırakılamaz." ToolTip="Çalışanın E-mail Adresini Giriniz." 
                             ValidationGroup="AddEmployeeValidationGroup">*</asp:RequiredFieldValidator>
    </p>
    <p>
        <asp:Label ID="SalaryPerDayLabel" runat="server" AssociatedControlID="SalaryPerDayTextBox">Günlük Ücreti (Maaş/Gün):</asp:Label>
        <asp:TextBox ID="SalaryPerDayTextBox" runat="server" CssClass="textEntry"></asp:TextBox>
        <asp:RequiredFieldValidator ID="SalaryPerDayRequired" runat="server" ControlToValidate="SalaryPerDayTextBox" 
                             CssClass="failureNotification" ErrorMessage="Çalışanın Günlük Ücreti Boş Bırakılamaz." ToolTip="Çalışanın Günlük Ücretini Giriniz." 
                             ValidationGroup="AddEmployeeValidationGroup">*</asp:RequiredFieldValidator>
    </p>
    <p>
        <asp:Label ID="HourPerDayLabel" runat="server" AssociatedControlID="HourPerDayTextBox">Günlük Çalışma Saati:</asp:Label>
        <asp:TextBox ID="HourPerDayTextBox" runat="server" CssClass="textEntry"></asp:TextBox>
        <asp:RequiredFieldValidator ID="HourPerDayTextBoxRequired" runat="server" ControlToValidate="HourPerDayTextBox" 
                             CssClass="failureNotification" ErrorMessage="Çalışanın Günlük Çalışma Saati Boş Bırakılamaz." ToolTip="Çalışanın Günlük Çalışma Saatini Giriniz." 
                             ValidationGroup="AddEmployeeValidationGroup">*</asp:RequiredFieldValidator>
    <br><br><br>
    <fieldset class="login">
    <legend>İş Yetenekleri</legend>
        <span class="failureNotification">
        <asp:Literal ID="Literal1" runat="server"></asp:Literal>
    </span>
    <asp:ValidationSummary ID="AddCapabilityValidationSummary" runat="server" CssClass="failureNotification" ValidationGroup="AddCapabilityValidationGroup" />
    &nbsp;&nbsp;&nbsp; 
    <asp:Label ID="Label1" runat="server" BackColor="Red" ForeColor="Black" Text="İyi"></asp:Label>
    &nbsp;&nbsp;
    <asp:RadioButton id="Radio1" type="radio" GroupName="Capability" runat="server" />
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    <asp:Label ID="Label2" runat="server" BackColor="#FF9933" ForeColor="Black" Text="Orta"></asp:Label>
    &nbsp;&nbsp;
    <asp:RadioButton id="Radio2" type="radio" GroupName="Capability" checked runat="server"  Text=""/>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    <asp:Label ID="Label3" runat="server" BackColor="Lime" ForeColor="Black" Text="Kötü"></asp:Label>
    &nbsp;&nbsp;
    <asp:RadioButton id="Radio3" type="radio" GroupName="Capability" runat="server"/><br />
    
    <p>
        <asp:Label ID="InsertedCapability" runat="server" Text="" EnableViewState="False" AssociatedControlID="CapabilityTextBox"></asp:Label>
        <asp:TextBox ID="CapabilityTextBox" runat="server" CssClass="textEntry"></asp:TextBox>
        <asp:RequiredFieldValidator ID="CapabilityRequired" runat="server" ControlToValidate="CapabilityTextBox" 
                             CssClass="failureNotification" ErrorMessage="Yetenek Girdisi Boş Bırakılamaz." ToolTip="Çalışana Ait Yetenek Giriniz." 
                             ValidationGroup="AddEmployeeValidationGroup">*</asp:RequiredFieldValidator>
    </p>
    <p>
        <div id="YeteneklerList"> </div>
    </p>
    <p>
        
        <input ID="YetenekEkle" type="button" value="Ekle" />
    </p>    
    </fieldset>
    <br />
    <br />
    <br />
    <asp:HiddenField ID="CapabilityString" runat="server" />
    <asp:HiddenField ID="SkillString" runat="server" />
    <asp:Button ID="Button1" runat="server" onclick="Button1_Click" 
        Text="Çalışan Ekle" ValidationGroup="AddEmployeeValidationGroup"/>
    <asp:Label ID="ResultMessage" runat="Server" ForeColor="red" EnableViewState="False"></asp:Label>
    <br />
    <br />
    <br />

    </fieldset>
</asp:Content>
